﻿// /////////////////////////////////// 
//  
//  
//      WiseLink CCF2.0 
//     (c)Copyright 2001-2010 WiseLink Xiaojun (David) Chen 
//        Authored and Owned Xiaojun (David) Chen 
//        All Right Reserved
//  
// /////////////////////////////////// 

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using WiseLink.RDS.Model.Common;
using WiseLink.RDS.Model;

namespace WiseLink.RDS.Model.TroubleCodeRepository
{
    public class TroubleCodeRepository : RDSRepositoryBase
    {

        public TroubleCodeRepository():base()
        {
        }

        public CodeData GetTroubleCode(string carType, string version, string code)
        {
            TroubleCode troubleCode = ccf20Ent.TroubleCodes.Where(c => c.CarType.Contains(carType) && c.Version.Contains(version) && c.Code.Contains(code)).FirstOrDefault();
            CodeData codeData = null;
            if (troubleCode != null)
            {
                codeData = new CodeData(troubleCode);

            }
            return codeData;
        }
    }
}
